package com.rem.utils;

import javax.servlet.http.Cookie;
import java.util.Objects;

/**
 * @author remembrance
 * @version 1.0
 * @date 2021/10/11 13:36
 */
public class CookieUtils {
    public  static Cookie findCookie(String CookieName,Cookie[] cookies){
        if (Objects.isNull(CookieName) || Objects.isNull(cookies) || cookies.length == 0){
            return null;
        }
        for (Cookie cookie : cookies) {
            if (CookieName.equals(cookie.getName())){
                return cookie;
            }
        }
        return null;
    }
}
